from selenium import webdriver


selenium_url = 'http://bode135.com:4444/wd/hub'
print(f'--- selenium_url: {selenium_url}')

options = webdriver.FirefoxOptions()
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-extensions')
options.add_argument("--headless")
options.add_argument("user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0")
driver = webdriver.Remote(selenium_url, options=options)

# url = 'http://www.baidu.com'
url = 'https://www.kaggle.com/datasets/farzadnekouei/gold-price-10-years-20132023'
# url = 'https://www.investing.com/commodities/gold-historical-data'
print(f'--- url: {url}')

driver.get(url)
print("--- get title:", driver.title)

driver.page_source
driver.close()



# driver = webdriver.Remote("http://10.31.72.54:8002/wd/hub", options=options)
# from selenium import webdriver
# from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# driver = webdriver.Remote(
#     command_executor="http://127.0.0.1:4444/wd/hub",
#     desired_capabilities=DesiredCapabilities.CHROME
# )
# driver.get("http://www.baidu.com")